public class PetDog {

    public String name;
    public String color;

    public void bark() {
        System.out.println(name + " 汪汪叫---");
    }

    public void wag(){
        System.out.println( name + " 摇尾巴---");
    }

    public static void main(String[] args) {
        PetDog dog1 = new PetDog();  /*用new实例化对象*/
        dog1.name = "阿黑";
        dog1.color = "黑黄";
        dog1.bark();
        dog1.wag();

        PetDog dog2 = new PetDog();  /*用new实例化对象*/
        dog2.name = "阿黄";
        dog2.color = "黄色";
        dog2.bark();
        dog2.wag();
    }
}
